<template>
	<view class="page">
		<cu-custom bgColor="bg-white" :isBack="true" >
			<block slot="content">标签列表</block>
		</cu-custom>
		
		<free-list-item v-for="(item,index) in list" :key="index" :title="item.name" :showRight="true" @click="handle(item)"></free-list-item>
	</view>
</template>

<script>
	import freeListItem from '@/components/free-ui/free-list-item.vue';
	// import $H from '@/common/free-lib/request.js';
	import auth from '@/components/mixin/auth.js';
	import { mapState } from 'vuex'
	export default {
		mixins:[auth],
		components: {
			freeListItem
		},
		data() {
			return {
				list:[]
			}
		},
		computed: {
			
		},
		created() {
			this.getData()
		},
		// 监听下拉刷新
		onPullDownRefresh() {
			this.getData().then(res=>{
				uni.showToast({
					title: '刷新成功',
					icon: 'none'
				});
				uni.stopPullDownRefresh()
			})
		},
		methods: {
			getData(){
				return new Promise((result,reject)=>{
					this.$C.get('/tag/list').then(res=>{
						this.list = res
						result(res)
					})
				})
			},
			handle(item){
				uni.navigateTo({
					url: '/pages/infochat/tag-read?id='+item.id,
				});
			}
		}
	}
</script>

<style>

</style>
